﻿@using System.Text
@model Dictionary<string, string>


<div id="breadCrumb">
    <div id="breadCrumbWrp">
    @{
        StringBuilder result = new StringBuilder();
        TagBuilder tagTitle = new TagBuilder("text");
        tagTitle.InnerHtml = "您现在的位置：";
        result.Append(tagTitle.ToString());
    }

    @foreach (var key in Model.Keys)
    {
        if (Model[key] != string.Empty)
        {
            TagBuilder tag = new TagBuilder("a");
            tag.MergeAttribute("href",Model[key]);
            tag.InnerHtml = key;
            result.Append(tag.ToString());
            TagBuilder tagP = new TagBuilder("text");
            tagP.InnerHtml = " > ";
            result.Append(tagP.ToString());
        }
        else
        {
            TagBuilder tagP = new TagBuilder("text");
            tagP.InnerHtml = key;
            result.Append(tagP);
        }
    }
    
    @MvcHtmlString.Create(result.ToString())
    </div>
</div>